package com.owen.pojo;

import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

public class Cake implements Serializable {

    // 主键ID
    private Integer id;

    // 商品名
    private String name;

    // 单价
    private Integer price;

    // 库存
    private Integer stock;

    // 生产日期
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    // 保质期
    private Integer guarantee;

    private List<Fruits> fruits;

    public Cake() {
    }

        public Cake(Integer id, String name, Integer price, Integer stock, Date createTime, Integer guarantee, List<Fruits> fruits) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.stock = stock;
        this.createTime = createTime;
        this.guarantee = guarantee;
        this.fruits = fruits;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getGuarantee() {
        return guarantee;
    }

    public void setGuarantee(Integer guarantee) {
        this.guarantee = guarantee;
    }

    public List<Fruits> getFruits() {
        return fruits;
    }

    public void setFruits(List<Fruits> fruits) {
        this.fruits = fruits;
    }

    @Override
    public String toString() {
        return "Cake{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", stock=" + stock +
                ", createTime=" + createTime +
                ", guarantee=" + guarantee +
                ", fruits=" + fruits +
                '}';
    }
}
